import 'package:sinosheets/network/api.dart';

class PayApis {
  //收银台支付列表 /pay/cashier get
  static Future<BaseResponse> cashier(Map params) {
    return HttpClient().request(
      "/pay/cashier",
      HttpMethod.get,
      parameters: params,
      isShowLoading: true,
    );
  }

  // 创建支付订单(调用三方支付接口)  /pay/createOrder POST
  static Future<BaseResponse> createOrder(Map params) {
    return HttpClient().request(
      "/pay/createOrder",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  /// 用户钱包余额  /pay/wallet/balance GET
  static Future<BaseResponse> balance() {
    return HttpClient().request(
      "/pay/wallet/balance",
      HttpMethod.get,
      isShowLoading: false,
    );
  }

  /// 币种列表  /pay/currentList GET
  static Future<BaseResponse> currentList() {
    return HttpClient().request(
      "/pay/currentList",
      HttpMethod.get,
      isShowLoading: true,
    );
  }

  /// 充值  /pay/recharge POST
  static Future<BaseResponse> recharge(Map params) {
    return HttpClient().request(
      "/pay/recharge",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  /// 偿还欠款  /pay/debit/repay POST
  static Future<BaseResponse> repay(Map params) {
    return HttpClient().request(
      "/pay/debit/repay",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  /// 用户欠款记录  /pay/debit/getList POST
  static Future<BaseResponse> debitList(Map params, {bool showLoading = false}) {
    return HttpClient().request(
      "/pay/debit/getList",
      HttpMethod.post,
      parameters: params,
      isShowLoading: showLoading,
    );
  }

  /// 余额明细列表  /pay/balanceDetail/getList POST
  static Future<BaseResponse> balanceDetailList(Map params, {bool showLoading = false}) {
    return HttpClient().request(
      "/pay/balanceDetail/getList",
      HttpMethod.post,
      parameters: params,
      isShowLoading: showLoading,
    );
  }

  /// 交易记录列表  /pay/transactionRecord/getList POST
  static Future<BaseResponse> transactionRecordList(Map params, {bool showLoading = true}) {
    return HttpClient().request(
      "/pay/transactionRecord/getList",
      HttpMethod.post,
      parameters: params,
      isShowLoading: showLoading,
    );
  }

  /// 业务类型列表  /pay/businessType/list GET
  static Future<BaseResponse> businessTypeList({bool showLoading = false}) {
    return HttpClient().request(
      "/pay/businessType/list",
      HttpMethod.get,
      isShowLoading: showLoading,
    );
  }

  /// 可提现列表  /pay/withdraw/available/list POST
  static Future<BaseResponse> withdrawAvailableList(Map params, {bool showLoading = true}) {
    return HttpClient().request(
      "/pay/withdraw/available/list",
      HttpMethod.post,
      parameters: params,
      isShowLoading: showLoading,
    );
  }

  /// 提现  /pay/withdraw POST
  static Future<BaseResponse> withdraw(Map params) {
    return HttpClient().request(
      "/pay/withdraw",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  /// 提现列表  /pay/list POST
  static Future<BaseResponse> withdrawList(Map params, {bool showLoading = true}) {
    return HttpClient().request(
      "/pay/withdraw/list",
      HttpMethod.post,
      parameters: params,
      isShowLoading: showLoading,
    );
  }

  /// 查询资金授权配置  /pay/fundAuthConfig/list GET
  static Future<BaseResponse> fundAuthList() {
    return HttpClient().request(
      "/pay/fundAuthConfig/list",
      HttpMethod.get,
      isShowLoading: true,
    );
  }

  /// 修改资金授权配置  /pay/fundAuthConfig/edit POST
  static Future<BaseResponse> fundAuthEdit(Map params) {
    return HttpClient().request(
      "/pay/fundAuthConfig/edit",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  /// 设置支付密码  /pay/wallet/setPassword POST
  static Future<BaseResponse> setPayPassword(Map params) {
    return HttpClient().request(
      "/pay/wallet/setPassword",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }

  ///获取收款银行列表 /pay/front/bank/list GET
  static Future<BaseResponse> frontBankList() {
    return HttpClient().request(
      "/pay/front/bank/list",
      HttpMethod.get,
      isShowLoading: true,
    );
  }

  /// 转账凭证提交  /pay/front/transfer/submit  POST
  static Future<BaseResponse> frontTransferSubmit(Map params) {
    return HttpClient().request(
      "/pay/front/transfer/submit",
      HttpMethod.post,
      parameters: params,
      isShowLoading: true,
    );
  }
}
